package com.item.model.controller;

import com.item.model.entity.WxUser;
import com.item.model.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("/add")
    public Integer addUser(@RequestBody WxUser wxUser){
        Integer integer = userService.addUser(wxUser);
        return  integer;
    }

    @RequestMapping("/get")
    public WxUser getUser(Integer id){
        return userService.getUser(id);
    }
    
    @RequestMapping("/update")
    public Integer updateUser(@RequestBody WxUser wxUser){
        return userService.updateUser(wxUser);
    }

    @RequestMapping("/del")
    public void delUser(Integer id){
        userService.delUser(id);
    }

}

